import {ref} from 'vue'
/**
 * 打字机效果 Hook
 * 提供可复用的打字机效果功能
 */
export function useTeamType() {
  //定义类型映射
  const map = ref({
    nums_key: '',
    time_key: '',
    //月卡key:
    month_key: '',
    //次卡可以
    once_key: '',
  })

  const getMapStr = (categoryId) => {
    categoryId = Number(categoryId)
    if([7].includes(categoryId)){
      map.value.nums_key = 'once_nums';
      map.value.time_key = 'month_nums';
      map.value.month_key = 'month_pay';
      map.value.once_key = 'once_pay';
    }else if([8].includes(categoryId)){
      map.value.nums_key = 'works_once_nums';
      map.value.time_key = 'works_month_nums';
      map.value.month_key = 'works_month_time';
      map.value.once_key = 'works_once_pay';
    }else if([9].includes(categoryId)){
      map.value.nums_key = 'emotion_once_nums';
      map.value.time_key = 'emotion_month_nums';
      map.value.month_key = 'emotion_month_time';
      map.value.once_key = 'emotion_once_pay';
    }else if([10].includes(categoryId)){
      map.value.nums_key = 'pr_once_nums';
      map.value.time_key = 'pr_month_nums';
      map.value.month_key = 'pr_month_time';
      map.value.once_key = 'pr_once_pay';
    }else if([11,12,13,14,15,16,17].includes(categoryId)){
      map.value.nums_key = 'group_once_nums';
      map.value.time_key = 'group_month_nums';
      map.value.month_key = 'group_month_time';
      map.value.once_key = 'group_once_pay';
    }else if([20].includes(categoryId)){
      map.value.nums_key = 'stu_once_nums';
      map.value.time_key = 'stu_month_nums';
      map.value.month_key = 'stu_month_time';
      map.value.once_key = 'stu_once_pay';
    }else if([19].includes(categoryId)){
      // 健康评测
      map.value.nums_key = 'medical_once_nums';
      map.value.time_key = 'medical_month_nums';  
      map.value.month_key = 'medical_month_pay';
      map.value.once_key = 'medical_once_pay';
    }else if([17, 18].includes(categoryId)){
      // 体质查询
      map.value.nums_key = 'tizhi_once';
      map.value.time_key = 'tizhi_month_nums';
      map.value.month_key = 'tizhi_month_pay';
      map.value.once_key = 'tizhi_once_nums';
    }else if([21, 22].includes(categoryId)){
      // 中医诊断/症状查询
      map.value.nums_key = 'symptom_inquiry_once_mums';
      map.value.time_key = 'symptom_inquiry_month_nums';
      map.value.month_key = 'zhongyao_month_pay';
      map.value.once_key = 'zhongyao_once_nums';
    }
    return map.value;
  }
  return {
   getMapStr
  }
}
